.class public Lcom/estrongs/android/pop/app/imageviewer/CropImage;
.super Lcom/estrongs/android/pop/app/imageviewer/MonitoredActivity;
.source "CropImage.java"


# instance fields
.field private e:Landroid/graphics/Bitmap$CompressFormat;

.field private f:Landroid/net/Uri;

.field private g:Z

.field private h:I

.field private i:I

.field private j:Z

.field private k:Z

.field private final l:Landroid/os/Handler;

.field private m:I

.field private n:I

.field private o:Z

.field private p:Z

.field q:Z

.field r:Z

.field s:Z

.field t:Z

.field private u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

.field private v:Landroid/content/ContentResolver;

.field private w:Landroid/graphics/Bitmap;

.field x:Lcom/estrongs/android/pop/app/imageviewer/HighlightView;

.field private y:Les/cm;

.field z:Ljava/lang/Runnable;


# direct methods
.method public constructor <init>()V
    .locals 3

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/imageviewer/MonitoredActivity;-><init>()V

    .line 2
    sget-object v0, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;

    iput-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->e:Landroid/graphics/Bitmap$CompressFormat;

    const/4 v0, 0x0

    .line 3
    iput-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->f:Landroid/net/Uri;

    const/4 v0, 0x0

    .line 4
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->g:Z

    const/4 v1, 0x1

    .line 5
    iput-boolean v1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->j:Z

    .line 6
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->k:Z

    .line 7
    new-instance v2, Landroid/os/Handler;

    invoke-direct {v2}, Landroid/os/Handler;-><init>()V

    iput-object v2, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->l:Landroid/os/Handler;

    .line 8
    iput-boolean v1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->p:Z

    .line 9
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->q:Z

    .line 10
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->r:Z

    .line 11
    new-instance v0, Lcom/estrongs/android/pop/app/imageviewer/CropImage$g;

    invoke-direct {v0, p0}, Lcom/estrongs/android/pop/app/imageviewer/CropImage$g;-><init>(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->z:Ljava/lang/Runnable;

    return-void
.end method

.method private A()V
    .locals 11
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "NewApi"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->x:Lcom/estrongs/android/pop/app/imageviewer/HighlightView;

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    iget-boolean v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->t:Z

    if-eqz v0, :cond_1

    return-void

    :cond_1
    const/4 v0, 0x1

    .line 3
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->t:Z

    .line 4
    iget v1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->m:I

    const/4 v2, 0x0

    const/4 v3, 0x0

    if-eqz v1, :cond_2

    iget v4, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->n:I

    if-eqz v4, :cond_2

    iget-boolean v5, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->o:Z

    if-nez v5, :cond_2

    .line 5
    sget-object v5, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    invoke-static {v1, v4, v5}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 6
    new-instance v4, Landroid/graphics/Canvas;

    invoke-direct {v4, v1}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 7
    iget-object v5, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->x:Lcom/estrongs/android/pop/app/imageviewer/HighlightView;

    invoke-virtual {v5}, Lcom/estrongs/android/pop/app/imageviewer/HighlightView;->a()Landroid/graphics/Rect;

    move-result-object v5

    .line 8
    new-instance v6, Landroid/graphics/Rect;

    iget v7, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->m:I

    iget v8, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->n:I

    invoke-direct {v6, v3, v3, v7, v8}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 9
    invoke-virtual {v5}, Landroid/graphics/Rect;->width()I

    move-result v7

    invoke-virtual {v6}, Landroid/graphics/Rect;->width()I

    move-result v8

    sub-int/2addr v7, v8

    div-int/lit8 v7, v7, 0x2

    .line 10
    invoke-virtual {v5}, Landroid/graphics/Rect;->height()I

    move-result v8

    invoke-virtual {v6}, Landroid/graphics/Rect;->height()I

    move-result v9

    sub-int/2addr v8, v9

    div-int/lit8 v8, v8, 0x2

    .line 11
    invoke-static {v3, v7}, Ljava/lang/Math;->max(II)I

    move-result v9

    invoke-static {v3, v8}, Ljava/lang/Math;->max(II)I

    move-result v10

    invoke-virtual {v5, v9, v10}, Landroid/graphics/Rect;->inset(II)V

    neg-int v7, v7

    .line 12
    invoke-static {v3, v7}, Ljava/lang/Math;->max(II)I

    move-result v7

    neg-int v8, v8

    invoke-static {v3, v8}, Ljava/lang/Math;->max(II)I

    move-result v8

    invoke-virtual {v6, v7, v8}, Landroid/graphics/Rect;->inset(II)V

    .line 13
    iget-object v7, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    invoke-virtual {v4, v7, v5, v6, v2}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    .line 14
    iget-object v4, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    invoke-virtual {v4}, Lcom/estrongs/android/pop/app/imageviewer/e;->a()V

    .line 15
    iget-object v4, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->recycle()V

    goto :goto_0

    .line 16
    :cond_2
    iget-object v1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->x:Lcom/estrongs/android/pop/app/imageviewer/HighlightView;

    invoke-virtual {v1}, Lcom/estrongs/android/pop/app/imageviewer/HighlightView;->a()Landroid/graphics/Rect;

    move-result-object v1

    .line 17
    iget v4, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->m:I

    iget v5, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->n:I

    invoke-direct {p0, v1, v4, v5}, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->a(Landroid/graphics/Rect;II)Landroid/graphics/Bitmap;

    move-result-object v1

    if-nez v1, :cond_3

    .line 18
    invoke-virtual {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f110770

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {p0, v0, v3}, Lcom/estrongs/android/ui/view/d;->a(Landroid/content/Context;Ljava/lang/CharSequence;I)V

    .line 19
    iget-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/app/imageviewer/e;->a()V

    .line 20
    iget-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    return-void

    .line 21
    :cond_3
    :goto_0
    iget-boolean v4, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->r:Z

    if-nez v4, :cond_4

    .line 22
    iget-object v4, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    invoke-virtual {v4}, Lcom/estrongs/android/pop/app/imageviewer/e;->a()V

    .line 23
    iget-object v4, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->recycle()V

    .line 24
    iget-object v4, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    invoke-virtual {v4, v1, v0}, Lcom/estrongs/android/pop/app/imageviewer/e;->a(Landroid/graphics/Bitmap;Z)V

    .line 25
    iget-object v4, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    invoke-virtual {v4, v0, v0}, Lcom/estrongs/android/pop/app/imageviewer/e;->a(ZZ)V

    .line 26
    iget-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    iget-object v0, v0, Lcom/estrongs/android/pop/app/imageviewer/CropImageView;->z:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 27
    :cond_4
    invoke-virtual {p0}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    const-string v4, "customSave"

    .line 28
    invoke-virtual {v0, v4}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    const/4 v5, -0x1

    if-eqz v0, :cond_6

    const-string v6, "data"

    .line 29
    invoke-virtual {v0, v6}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v7

    if-nez v7, :cond_5

    const-string v7, "return-data"

    .line 30
    invoke-virtual {v0, v7}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_6

    .line 31
    :cond_5
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 32
    invoke-virtual {v0, v6, v1}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V

    .line 33
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    const-string v2, "inline-data"

    .line 34
    invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/content/Intent;->putExtras(Landroid/os/Bundle;)Landroid/content/Intent;

    move-result-object v0

    .line 35
    invoke-virtual {p0, v5, v0}, Landroid/app/Activity;->setResult(ILandroid/content/Intent;)V

    .line 36
    invoke-virtual {p0}, Landroid/app/Activity;->finish()V

    goto/16 :goto_4

    :cond_6
    if-eqz v4, :cond_7

    .line 37
    :try_start_0
    new-instance v0, Ljava/io/FileOutputStream;

    invoke-direct {v0, v4}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V

    .line 38
    sget-object v4, Landroid/graphics/Bitmap$CompressFormat;->PNG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v6, 0x5a

    invoke-virtual {v1, v4, v6, v0}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 39
    invoke-virtual {p0, v5, v2}, Landroid/app/Activity;->setResult(ILandroid/content/Intent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_1

    :catchall_0
    move-exception v0

    goto :goto_2

    :catch_0
    move-exception v0

    .line 40
    :try_start_1
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 41
    invoke-virtual {p0, v3, v2}, Landroid/app/Activity;->setResult(ILandroid/content/Intent;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 42
    :goto_1
    invoke-virtual {p0}, Landroid/app/Activity;->finish()V

    goto :goto_4

    .line 43
    :goto_2
    throw v0

    .line 44
    :cond_7
    iget-boolean v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->q:Z

    if-eqz v3, :cond_8

    .line 45
    iget-object v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->x:Lcom/estrongs/android/pop/app/imageviewer/HighlightView;

    invoke-virtual {v3}, Lcom/estrongs/android/pop/app/imageviewer/HighlightView;->b()Landroid/graphics/Rect;

    move-result-object v3

    const v4, 0x7f1102b7

    .line 46
    invoke-virtual {p0, v4}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v4

    new-instance v5, Lcom/estrongs/android/pop/app/imageviewer/CropImage$d;

    invoke-direct {v5, p0, v0, v1, v3}, Lcom/estrongs/android/pop/app/imageviewer/CropImage$d;-><init>(Lcom/estrongs/android/pop/app/imageviewer/CropImage;Landroid/os/Bundle;Landroid/graphics/Bitmap;Landroid/graphics/Rect;)V

    iget-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->l:Landroid/os/Handler;

    invoke-static {p0, v2, v4, v5, v0}, Lcom/estrongs/android/pop/app/imageviewer/i;->a(Lcom/estrongs/android/pop/app/imageviewer/MonitoredActivity;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Runnable;Landroid/os/Handler;)V

    goto :goto_4

    .line 47
    :cond_8
    iget-boolean v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->g:Z

    if-eqz v0, :cond_9

    .line 48
    invoke-virtual {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v3, 0x7f1106c5

    invoke-virtual {v0, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    goto :goto_3

    :cond_9
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    .line 49
    invoke-virtual {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f110066

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, "..."

    invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 50
    :goto_3
    new-instance v3, Lcom/estrongs/android/pop/app/imageviewer/CropImage$e;

    invoke-direct {v3, p0, v1}, Lcom/estrongs/android/pop/app/imageviewer/CropImage$e;-><init>(Lcom/estrongs/android/pop/app/imageviewer/CropImage;Landroid/graphics/Bitmap;)V

    iget-object v1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->l:Landroid/os/Handler;

    invoke-static {p0, v2, v0, v3, v1}, Lcom/estrongs/android/pop/app/imageviewer/i;->a(Lcom/estrongs/android/pop/app/imageviewer/MonitoredActivity;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Runnable;Landroid/os/Handler;)V

    :goto_4
    return-void
.end method

.method private B()V
    .locals 4

    .line 1
    invoke-virtual {p0}, Landroid/app/Activity;->isFinishing()Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    .line 2
    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    iget-object v1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Lcom/estrongs/android/pop/app/imageviewer/e;->a(Landroid/graphics/Bitmap;Z)V

    const/4 v0, 0x0

    .line 3
    invoke-virtual {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f110b52

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    new-instance v2, Lcom/estrongs/android/pop/app/imageviewer/CropImage$c;

    invoke-direct {v2, p0}, Lcom/estrongs/android/pop/app/imageviewer/CropImage$c;-><init>(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)V

    iget-object v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->l:Landroid/os/Handler;

    .line 4
    invoke-static {p0, v0, v1, v2, v3}, Lcom/estrongs/android/pop/app/imageviewer/i;->a(Lcom/estrongs/android/pop/app/imageviewer/MonitoredActivity;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Runnable;Landroid/os/Handler;)V

    return-void
.end method

.method private a(Landroid/graphics/Rect;II)Landroid/graphics/Bitmap;
    .locals 15
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "NewApi"
        }
    .end annotation

    move-object v1, p0

    move-object/from16 v2, p1

    .line 4
    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Rect;->width()I

    move-result v3

    .line 5
    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Rect;->height()I

    move-result v4

    const/4 v5, 0x0

    if-lez v3, :cond_7

    if-gtz v4, :cond_0

    goto/16 :goto_4

    .line 6
    :cond_0
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v6, 0xa

    const/4 v7, 0x0

    if-lt v0, v6, :cond_2

    .line 7
    :try_start_0
    invoke-virtual {p0}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Intent;->getData()Landroid/net/Uri;

    move-result-object v0

    .line 8
    invoke-virtual {v0}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/net/Uri;->decode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 9
    invoke-static {v0}, Lcom/estrongs/android/util/h0;->y1(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_2

    const-string v6, "file://"

    .line 10
    invoke-virtual {v0, v6}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_1

    const/4 v6, 0x7

    .line 11
    invoke-virtual {v0, v6}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v0

    .line 12
    :cond_1
    new-instance v6, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v6}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    const/4 v8, 0x1

    .line 13
    iput-boolean v8, v6, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 14
    invoke-static {v0, v6}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    .line 15
    iget v9, v6, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    int-to-float v9, v9

    .line 16
    iget-object v10, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    invoke-virtual {v10}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v10

    int-to-float v10, v10

    div-float/2addr v9, v10

    .line 17
    new-instance v10, Landroid/graphics/Rect;

    iget v11, v2, Landroid/graphics/Rect;->left:I

    int-to-float v11, v11

    mul-float v11, v11, v9

    float-to-int v11, v11

    iget v12, v2, Landroid/graphics/Rect;->top:I

    int-to-float v12, v12

    mul-float v12, v12, v9

    float-to-int v12, v12

    iget v13, v2, Landroid/graphics/Rect;->right:I

    int-to-float v13, v13

    mul-float v13, v13, v9

    float-to-int v13, v13

    iget v14, v2, Landroid/graphics/Rect;->bottom:I

    int-to-float v14, v14

    mul-float v14, v14, v9

    float-to-int v9, v14

    invoke-direct {v10, v11, v12, v13, v9}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 18
    iput-boolean v7, v6, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 19
    iput v8, v6, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 20
    :goto_0
    :try_start_1
    invoke-static {v0, v8}, Landroid/graphics/BitmapRegionDecoder;->newInstance(Ljava/lang/String;Z)Landroid/graphics/BitmapRegionDecoder;

    move-result-object v9

    .line 21
    invoke-virtual {v9, v10, v6}, Landroid/graphics/BitmapRegionDecoder;->decodeRegion(Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0
    :try_end_1
    .catch Ljava/lang/OutOfMemoryError; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_1

    .line 22
    :catch_0
    :try_start_2
    iget v9, v6, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    mul-int/lit8 v9, v9, 0x2

    iput v9, v6, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_0

    :catch_1
    move-exception v0

    .line 23
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_2
    move-object v0, v5

    :goto_1
    if-nez v0, :cond_4

    .line 24
    :try_start_3
    iget-boolean v6, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->k:Z

    if-eqz v6, :cond_3

    sget-object v6, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    goto :goto_2

    :cond_3
    sget-object v6, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    :goto_2
    invoke-static {v3, v4, v6}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 25
    new-instance v6, Landroid/graphics/Canvas;

    invoke-direct {v6, v0}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 26
    new-instance v8, Landroid/graphics/Rect;

    invoke-direct {v8, v7, v7, v3, v4}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 27
    iget-object v9, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    invoke-virtual {v6, v9, v2, v8, v5}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Paint;)V
    :try_end_3
    .catch Ljava/lang/OutOfMemoryError; {:try_start_3 .. :try_end_3} :catch_2

    :catch_2
    :cond_4
    move-object v2, v0

    .line 28
    iget-boolean v0, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->k:Z

    if-eqz v0, :cond_5

    if-eqz v2, :cond_5

    .line 29
    new-instance v0, Landroid/graphics/Canvas;

    invoke-direct {v0, v2}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 30
    new-instance v5, Landroid/graphics/Path;

    invoke-direct {v5}, Landroid/graphics/Path;-><init>()V

    int-to-float v3, v3

    const/high16 v6, 0x40000000    # 2.0f

    div-float/2addr v3, v6

    int-to-float v4, v4

    div-float/2addr v4, v6

    .line 31
    sget-object v6, Landroid/graphics/Path$Direction;->CW:Landroid/graphics/Path$Direction;

    invoke-virtual {v5, v3, v4, v3, v6}, Landroid/graphics/Path;->addCircle(FFFLandroid/graphics/Path$Direction;)V

    .line 32
    :try_start_4
    sget-object v3, Landroid/graphics/Region$Op;->DIFFERENCE:Landroid/graphics/Region$Op;

    invoke-virtual {v0, v5, v3}, Landroid/graphics/Canvas;->clipPath(Landroid/graphics/Path;Landroid/graphics/Region$Op;)Z
    :try_end_4
    .catch Ljava/lang/UnsupportedOperationException; {:try_start_4 .. :try_end_4} :catch_3

    .line 33
    :catch_3
    sget-object v3, Landroid/graphics/PorterDuff$Mode;->CLEAR:Landroid/graphics/PorterDuff$Mode;

    invoke-virtual {v0, v7, v3}, Landroid/graphics/Canvas;->drawColor(ILandroid/graphics/PorterDuff$Mode;)V

    :cond_5
    if-eqz p2, :cond_6

    if-eqz p3, :cond_6

    .line 34
    iget-boolean v0, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->o:Z

    if-eqz v0, :cond_6

    .line 35
    :try_start_5
    new-instance v8, Landroid/graphics/Matrix;

    invoke-direct {v8}, Landroid/graphics/Matrix;-><init>()V

    iget-boolean v12, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->p:Z

    const/4 v13, 0x1

    move-object v9, v2

    move/from16 v10, p2

    move/from16 v11, p3

    invoke-static/range {v8 .. v13}, Lcom/estrongs/android/pop/app/imageviewer/i;->a(Landroid/graphics/Matrix;Landroid/graphics/Bitmap;IIZZ)Landroid/graphics/Bitmap;

    move-result-object v2
    :try_end_5
    .catch Ljava/lang/OutOfMemoryError; {:try_start_5 .. :try_end_5} :catch_4

    goto :goto_3

    :catch_4
    move-exception v0

    .line 36
    invoke-virtual {v0}, Ljava/lang/OutOfMemoryError;->printStackTrace()V

    :cond_6
    :goto_3
    return-object v2

    :cond_7
    :goto_4
    return-object v5
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/imageviewer/CropImage;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 0

    .line 2
    iput-object p1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    return-object p1
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/imageviewer/CropImage;Landroid/graphics/Rect;II)Landroid/graphics/Bitmap;
    .locals 0

    .line 3
    invoke-direct {p0, p1, p2, p3}, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->a(Landroid/graphics/Rect;II)Landroid/graphics/Bitmap;

    move-result-object p0

    return-object p0
.end method

.method private a(Landroid/graphics/Bitmap;)V
    .locals 18

    move-object/from16 v1, p0

    move-object/from16 v12, p1

    .line 37
    iget-object v0, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->f:Landroid/net/Uri;

    const-string v13, "CropImage"

    const/4 v14, -0x1

    if-eqz v0, :cond_1

    const/4 v2, 0x0

    .line 38
    :try_start_0
    iget-object v3, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->v:Landroid/content/ContentResolver;

    invoke-virtual {v3, v0}, Landroid/content/ContentResolver;->openOutputStream(Landroid/net/Uri;)Ljava/io/OutputStream;

    move-result-object v2

    if-eqz v2, :cond_0

    .line 39
    iget-object v0, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->e:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v3, 0x4b

    invoke-virtual {v12, v0, v3, v2}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 40
    :cond_0
    :goto_0
    invoke-static {v2}, Lcom/estrongs/fs/util/f;->a(Ljava/io/Closeable;)V

    goto :goto_1

    :catchall_0
    move-exception v0

    goto :goto_2

    :catch_0
    move-exception v0

    .line 41
    :try_start_1
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Cannot open file: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v4, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->f:Landroid/net/Uri;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v13, v3, v0}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 42
    :goto_1
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 43
    new-instance v2, Landroid/content/Intent;

    iget-object v3, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->f:Landroid/net/Uri;

    invoke-virtual {v3}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 44
    invoke-virtual {v2, v0}, Landroid/content/Intent;->putExtras(Landroid/os/Bundle;)Landroid/content/Intent;

    move-result-object v0

    .line 45
    invoke-virtual {v1, v14, v0}, Landroid/app/Activity;->setResult(ILandroid/content/Intent;)V

    goto/16 :goto_3

    .line 46
    :goto_2
    invoke-static {v2}, Lcom/estrongs/fs/util/f;->a(Ljava/io/Closeable;)V

    .line 47
    throw v0

    .line 48
    :cond_1
    iget-boolean v0, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->g:Z

    const/4 v2, 0x0

    if-eqz v0, :cond_2

    .line 49
    :try_start_2
    invoke-virtual/range {p0 .. p1}, Landroid/app/Activity;->setWallpaper(Landroid/graphics/Bitmap;)V

    .line 50
    invoke-virtual {v1, v14}, Landroid/app/Activity;->setResult(I)V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    goto/16 :goto_3

    :catch_1
    move-exception v0

    const-string v3, "Failed to set wallpaper."

    .line 51
    invoke-static {v13, v3, v0}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 52
    invoke-virtual {v1, v2}, Landroid/app/Activity;->setResult(I)V

    goto/16 :goto_3

    .line 53
    :cond_2
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 54
    iget-object v3, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->x:Lcom/estrongs/android/pop/app/imageviewer/HighlightView;

    invoke-virtual {v3}, Lcom/estrongs/android/pop/app/imageviewer/HighlightView;->a()Landroid/graphics/Rect;

    move-result-object v3

    invoke-virtual {v3}, Landroid/graphics/Rect;->toString()Ljava/lang/String;

    move-result-object v3

    const-string v4, "rect"

    invoke-virtual {v0, v4, v3}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 55
    new-instance v3, Ljava/io/File;

    iget-object v4, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->y:Les/cm;

    invoke-interface {v4}, Les/cm;->i()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 56
    new-instance v4, Ljava/io/File;

    invoke-virtual {v3}, Ljava/io/File;->getParent()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 57
    invoke-virtual {v3}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v3

    const-string v5, "."

    .line 58
    invoke-virtual {v3, v5}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v5

    invoke-virtual {v3, v2, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    :cond_3
    const/4 v5, 0x1

    add-int/2addr v2, v5

    .line 59
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v4}, Ljava/io/File;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v7, "/"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v6, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v7, "-"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v6, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v8, ".jpg"

    invoke-virtual {v6, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    .line 60
    new-instance v9, Ljava/io/File;

    invoke-direct {v9, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v9}, Ljava/io/File;->exists()Z

    move-result v6

    if-nez v6, :cond_3

    :try_start_3
    new-array v11, v5, [I

    .line 61
    iget-object v5, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->v:Landroid/content/ContentResolver;

    iget-object v6, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->y:Les/cm;

    .line 62
    invoke-interface {v6}, Les/cm;->getTitle()Ljava/lang/String;

    move-result-object v6

    iget-object v9, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->y:Les/cm;

    .line 63
    invoke-interface {v9}, Les/cm;->b()J

    move-result-wide v9

    const/4 v15, 0x0

    .line 64
    invoke-virtual {v4}, Ljava/io/File;->toString()Ljava/lang/String;

    move-result-object v16

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v4, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v4, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    const/16 v17, 0x0

    move-object v2, v5

    move-object v3, v6

    move-wide v4, v9

    move-object v6, v15

    move-object/from16 v7, v16

    move-object/from16 v9, p1

    move-object/from16 v10, v17

    .line 65
    invoke-static/range {v2 .. v11}, Lcom/estrongs/android/pop/app/imageviewer/ImageManager;->a(Landroid/content/ContentResolver;Ljava/lang/String;JLandroid/location/Location;Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;[B[I)Landroid/net/Uri;

    move-result-object v2

    .line 66
    new-instance v3, Landroid/content/Intent;

    invoke-direct {v3}, Landroid/content/Intent;-><init>()V

    .line 67
    invoke-virtual {v2}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v3, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v2

    .line 68
    invoke-virtual {v2, v0}, Landroid/content/Intent;->putExtras(Landroid/os/Bundle;)Landroid/content/Intent;

    move-result-object v0

    .line 69
    invoke-virtual {v1, v14, v0}, Landroid/app/Activity;->setResult(ILandroid/content/Intent;)V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_2

    goto :goto_3

    :catch_2
    move-exception v0

    const-string v2, "store image fail, continue anyway"

    .line 70
    invoke-static {v13, v2, v0}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 71
    :goto_3
    iget-object v0, v1, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->l:Landroid/os/Handler;

    new-instance v2, Lcom/estrongs/android/pop/app/imageviewer/CropImage$f;

    invoke-direct {v2, v1, v12}, Lcom/estrongs/android/pop/app/imageviewer/CropImage$f;-><init>(Lcom/estrongs/android/pop/app/imageviewer/CropImage;Landroid/graphics/Bitmap;)V

    invoke-virtual {v0, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 72
    invoke-virtual/range {p0 .. p0}, Landroid/app/Activity;->finish()V

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->A()V

    return-void
.end method

.method static synthetic b(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)Les/cm;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->y:Les/cm;

    return-object p0
.end method

.method static synthetic b(Lcom/estrongs/android/pop/app/imageviewer/CropImage;Landroid/graphics/Bitmap;)V
    .locals 0

    .line 2
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->a(Landroid/graphics/Bitmap;)V

    return-void
.end method

.method static synthetic c(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)I
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->h:I

    return p0
.end method

.method static synthetic d(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)I
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->i:I

    return p0
.end method

.method static synthetic e(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)Z
    .locals 0

    .line 1
    iget-boolean p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->j:Z

    return p0
.end method

.method static synthetic f(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)Landroid/graphics/Bitmap;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    return-object p0
.end method

.method static synthetic g(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)Lcom/estrongs/android/pop/app/imageviewer/CropImageView;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    return-object p0
.end method

.method static synthetic h(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)Landroid/os/Handler;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->l:Landroid/os/Handler;

    return-object p0
.end method

.method static synthetic i(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)I
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->n:I

    return p0
.end method

.method static synthetic j(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)I
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->m:I

    return p0
.end method

.method static synthetic k(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)Z
    .locals 0

    .line 1
    iget-boolean p0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->k:Z

    return p0
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 5

    .line 1
    invoke-super {p0, p1}, Lcom/estrongs/android/pop/app/imageviewer/MonitoredActivity;->onCreate(Landroid/os/Bundle;)V

    .line 2
    invoke-virtual {p0}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object p1

    iput-object p1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->v:Landroid/content/ContentResolver;

    const p1, 0x7f0c01b6

    .line 3
    invoke-virtual {p0, p1}, Lcom/estrongs/android/pop/esclasses/ESActivity;->setContentView(I)V

    const p1, 0x7f090528

    .line 4
    invoke-virtual {p0, p1}, Landroidx/appcompat/app/AppCompatActivity;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    iput-object p1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->u:Lcom/estrongs/android/pop/app/imageviewer/CropImageView;

    .line 5
    invoke-static {p0}, Lcom/estrongs/android/pop/app/imageviewer/f;->a(Landroid/app/Activity;)V

    .line 6
    invoke-virtual {p0}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;

    move-result-object p1

    .line 7
    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    const/4 v1, 0x1

    if-eqz v0, :cond_4

    const-string v2, "circleCrop"

    .line 8
    invoke-virtual {v0, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_0

    .line 9
    iput-boolean v1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->k:Z

    .line 10
    iput v1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->h:I

    .line 11
    iput v1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->i:I

    :cond_0
    const/4 v2, 0x0

    const-string v3, "setWallpaper"

    .line 12
    invoke-virtual {v0, v3, v2}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v3

    iput-boolean v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->g:Z

    const-string v4, "set_wallpaper"

    .line 13
    invoke-virtual {v0, v4, v2}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v4

    or-int/2addr v3, v4

    iput-boolean v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->g:Z

    const-string v4, "show_drm_settable"

    .line 14
    invoke-virtual {v0, v4, v2}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v4

    or-int/2addr v3, v4

    iput-boolean v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->g:Z

    if-nez v3, :cond_1

    const-string v3, "output"

    .line 15
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v3

    check-cast v3, Landroid/net/Uri;

    iput-object v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->f:Landroid/net/Uri;

    if-eqz v3, :cond_1

    const-string v3, "outputFormat"

    .line 16
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    if-eqz v3, :cond_1

    .line 17
    invoke-static {v3}, Landroid/graphics/Bitmap$CompressFormat;->valueOf(Ljava/lang/String;)Landroid/graphics/Bitmap$CompressFormat;

    move-result-object v3

    iput-object v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->e:Landroid/graphics/Bitmap$CompressFormat;

    :cond_1
    const-string v3, "data"

    .line 18
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v3

    check-cast v3, Landroid/graphics/Bitmap;

    iput-object v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    const-string v3, "aspectX"

    .line 19
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->h:I

    const-string v3, "aspectY"

    .line 20
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->i:I

    const-string v3, "outputX"

    .line 21
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->m:I

    const-string v3, "outputY"

    .line 22
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->n:I

    const-string v3, "scale"

    .line 23
    invoke-virtual {v0, v3, v1}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v3

    iput-boolean v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->o:Z

    const-string v3, "scaleUpIfNeeded"

    .line 24
    invoke-virtual {v0, v3, v1}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v3

    iput-boolean v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->p:Z

    const-string v3, "noFaceDetection"

    .line 25
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_3

    .line 26
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_2

    goto :goto_0

    :cond_2
    const/4 v3, 0x0

    goto :goto_1

    :cond_3
    :goto_0
    const/4 v3, 0x1

    :goto_1
    iput-boolean v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->j:Z

    const-string v3, "crop2Direction"

    .line 27
    invoke-virtual {v0, v3, v2}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v3

    iput-boolean v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->q:Z

    const-string v3, "fixCropMode"

    .line 28
    invoke-virtual {v0, v3, v2}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v3

    iput-boolean v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->r:Z

    const-string v3, "title"

    .line 29
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_4

    const v3, 0x7f090ba1

    .line 30
    invoke-virtual {p0, v3}, Landroidx/appcompat/app/AppCompatActivity;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/TextView;

    .line 31
    invoke-virtual {v3, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 32
    invoke-virtual {v3, v2}, Landroid/widget/TextView;->setVisibility(I)V

    .line 33
    invoke-virtual {v3}, Landroid/widget/TextView;->bringToFront()V

    .line 34
    :cond_4
    iget-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    if-nez v0, :cond_6

    .line 35
    invoke-virtual {p1}, Landroid/content/Intent;->getData()Landroid/net/Uri;

    move-result-object p1

    .line 36
    invoke-virtual {p1}, Landroid/net/Uri;->getScheme()Ljava/lang/String;

    move-result-object v0

    const-string v2, "content"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    const/4 v2, 0x0

    if-eqz v0, :cond_5

    .line 37
    new-instance v0, Les/fm;

    iget-object v3, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->v:Landroid/content/ContentResolver;

    invoke-direct {v0, v2, v3, p1}, Les/fm;-><init>(Les/dm;Landroid/content/ContentResolver;Landroid/net/Uri;)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->y:Les/cm;

    goto :goto_2

    .line 38
    :cond_5
    new-instance v0, Les/am;

    invoke-static {p0}, Lcom/estrongs/fs/f;->a(Landroid/content/Context;)Lcom/estrongs/fs/f;

    move-result-object v3

    invoke-virtual {p1}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-direct {v0, v2, v3, p1}, Les/am;-><init>(Les/dm;Lcom/estrongs/fs/f;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->y:Les/cm;

    .line 39
    :goto_2
    iget-object p1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->y:Les/cm;

    if-eqz p1, :cond_6

    .line 40
    invoke-interface {p1, v1}, Les/cm;->a(Z)Landroid/graphics/Bitmap;

    move-result-object p1

    iput-object p1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    .line 41
    :cond_6
    iget-object p1, p0, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->w:Landroid/graphics/Bitmap;

    if-nez p1, :cond_7

    .line 42
    invoke-virtual {p0}, Landroid/app/Activity;->finish()V

    return-void

    .line 43
    :cond_7
    invoke-virtual {p0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object p1

    const/16 v0, 0x400

    invoke-virtual {p1, v0}, Landroid/view/Window;->addFlags(I)V

    const p1, 0x7f090311

    .line 44
    invoke-virtual {p0, p1}, Landroidx/appcompat/app/AppCompatActivity;->findViewById(I)Landroid/view/View;

    move-result-object p1

    new-instance v0, Lcom/estrongs/android/pop/app/imageviewer/CropImage$a;

    invoke-direct {v0, p0}, Lcom/estrongs/android/pop/app/imageviewer/CropImage$a;-><init>(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)V

    invoke-virtual {p1, v0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    const p1, 0x7f0909db

    .line 45
    invoke-virtual {p0, p1}, Landroidx/appcompat/app/AppCompatActivity;->findViewById(I)Landroid/view/View;

    move-result-object p1

    new-instance v0, Lcom/estrongs/android/pop/app/imageviewer/CropImage$b;

    invoke-direct {v0, p0}, Lcom/estrongs/android/pop/app/imageviewer/CropImage$b;-><init>(Lcom/estrongs/android/pop/app/imageviewer/CropImage;)V

    invoke-virtual {p1, v0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 46
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/imageviewer/CropImage;->B()V

    return-void
.end method

.method protected onDestroy()V
    .locals 0

    .line 1
    invoke-super {p0}, Lcom/estrongs/android/pop/app/imageviewer/MonitoredActivity;->onDestroy()V

    return-void
.end method

.method protected onPause()V
    .locals 0

    .line 1
    invoke-super {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;->onPause()V

    return-void
.end method
